\(\int \frac {\sin ^2(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\) [75]
Optimal result
Integrand size = 23, antiderivative size = 138 \[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {(a+3 b) x}{2 (a-b)^3}-\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 \sqrt {a} (a-b)^3 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{(a-b)^2 f \left (a+b \tan ^2(e+f x)\right )}
\]
[Out]
1/2*(a+3*b)*x/(a-b)^3-1/2*(3*a+b)*arctan(b^(1/2)*tan(f*x+e)/a^(1/2))*b^(1/2)/(a-b)^3/f/a^(1/2)-1/2*cos(f*x+e)*
sin(f*x+e)/(a-b)/f/(a+b*tan(f*x+e)^2)-b*tan(f*x+e)/(a-b)^2/f/(a+b*tan(f*x+e)^2)
Rubi [A] (verified)
Time = 0.18 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00, number of
steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3744, 482, 541, 536, 209, 211}
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 \sqrt {a} f (a-b)^3}-\frac {b \tan (e+f x)}{f (a-b)^2 \left (a+b \tan ^2(e+f x)\right )}-\frac {\sin (e+f x) \cos (e+f x)}{2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}+\frac {x (a+3 b)}{2 (a-b)^3}
\]
[In]
Int[Sin[e + f*x]^2/(a + b*Tan[e + f*x]^2)^2,x]
[Out]
((a + 3*b)*x)/(2*(a - b)^3) - (Sqrt[b]*(3*a + b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(2*Sqrt[a]*(a - b)^3*
f) - (Cos[e + f*x]*Sin[e + f*x])/(2*(a - b)*f*(a + b*Tan[e + f*x]^2)) - (b*Tan[e + f*x])/((a - b)^2*f*(a + b*T
an[e + f*x]^2))
Rule 209
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])
Rule 211
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]
Rule 482
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(n - 1
)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(n*(b*c - a*d)*(p + 1))), x] - Dist[e^n/(n*(b*c -
a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]
Rule 536
Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]
Rule 541
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> Simp[(
-(b*e - a*f))*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*n*(b*c - a*d)*(p + 1))), x] + Dist[1/(a*n*(b*c - a
*d)*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(b*e - a*f) + e*n*(b*c - a*d)*(p + 1) + d*(b*e - a*
f)*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, q}, x] && LtQ[p, -1]
Rule 3744
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]
Rubi steps \begin{align*}
\text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right )^2 \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}+\frac {\text {Subst}\left (\int \frac {a-3 b x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{2 (a-b) f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{(a-b)^2 f \left (a+b \tan ^2(e+f x)\right )}+\frac {\text {Subst}\left (\int \frac {2 a (a+b)-4 a b x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{4 a (a-b)^2 f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{(a-b)^2 f \left (a+b \tan ^2(e+f x)\right )}-\frac {(b (3 a+b)) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{2 (a-b)^3 f}+\frac {(a+3 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 (a-b)^3 f} \\ & = \frac {(a+3 b) x}{2 (a-b)^3}-\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 \sqrt {a} (a-b)^3 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{(a-b)^2 f \left (a+b \tan ^2(e+f x)\right )} \\
\end{align*}
Mathematica [A] (verified)
Time = 2.23 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.80
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {-2 (a+3 b) (e+f x)+\frac {2 \sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a}}+(a-b) \sin (2 (e+f x))+\frac {2 (a-b) b \sin (2 (e+f x))}{a+b+(a-b) \cos (2 (e+f x))}}{4 (a-b)^3 f}
\]
[In]
Integrate[Sin[e + f*x]^2/(a + b*Tan[e + f*x]^2)^2,x]
[Out]
-1/4*(-2*(a + 3*b)*(e + f*x) + (2*Sqrt[b]*(3*a + b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/Sqrt[a] + (a - b)*
Sin[2*(e + f*x)] + (2*(a - b)*b*Sin[2*(e + f*x)])/(a + b + (a - b)*Cos[2*(e + f*x)]))/((a - b)^3*f)
Maple [A] (verified)
Time = 3.55 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.87
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {-\frac {b \left (\frac {\left (\frac {a}{2}-\frac {b}{2}\right ) \tan \left (f x +e \right )}{a +b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a +b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{\left (a -b \right )^{3}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +3 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{3}}}{f}\) |
\(120\) |
default |
\(\frac {-\frac {b \left (\frac {\left (\frac {a}{2}-\frac {b}{2}\right ) \tan \left (f x +e \right )}{a +b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a +b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{\left (a -b \right )^{3}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +3 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{3}}}{f}\) |
\(120\) |
risch |
\(\frac {x a}{2 \left (a^{2}-2 a b +b^{2}\right ) \left (a -b \right )}+\frac {3 x b}{2 \left (a^{2}-2 a b +b^{2}\right ) \left (a -b \right )}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{8 \left (a^{2}-2 a b +b^{2}\right ) f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{8 \left (a^{2}-2 a b +b^{2}\right ) f}-\frac {i b \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}+b \,{\mathrm e}^{2 i \left (f x +e \right )}+a -b \right )}{f \left (-a +b \right )^{3} \left (-a \,{\mathrm e}^{4 i \left (f x +e \right )}+b \,{\mathrm e}^{4 i \left (f x +e \right )}-2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a +b \right )}-\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 \left (a -b \right )^{3} f}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right ) b}{4 a \left (a -b \right )^{3} f}+\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 \left (a -b \right )^{3} f}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right ) b}{4 a \left (a -b \right )^{3} f}\) |
\(415\) |
| | |
|
|
|
[In]
int(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
[Out]
1/f*(-1/(a-b)^3*b*((1/2*a-1/2*b)*tan(f*x+e)/(a+b*tan(f*x+e)^2)+1/2*(3*a+b)/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*
b)^(1/2)))+1/(a-b)^3*((-1/2*a+1/2*b)*tan(f*x+e)/(1+tan(f*x+e)^2)+1/2*(a+3*b)*arctan(tan(f*x+e))))
Fricas [A] (verification not implemented)
none
Time = 0.35 (sec) , antiderivative size = 568, normalized size of antiderivative = 4.12
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\left [\frac {4 \, {\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} f x \cos \left (f x + e\right )^{2} + 4 \, {\left (a b + 3 \, b^{2}\right )} f x - {\left ({\left (3 \, a^{2} - 2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt {-\frac {b}{a}} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} - 4 \, {\left ({\left (a^{2} + a b\right )} \cos \left (f x + e\right )^{3} - a b \cos \left (f x + e\right )\right )} \sqrt {-\frac {b}{a}} \sin \left (f x + e\right ) + b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} + 2 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}}\right ) - 4 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} + 2 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, {\left ({\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - 3 \, a^{2} b^{2} + 3 \, a b^{3} - b^{4}\right )} f\right )}}, \frac {2 \, {\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} f x \cos \left (f x + e\right )^{2} + 2 \, {\left (a b + 3 \, b^{2}\right )} f x + {\left ({\left (3 \, a^{2} - 2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {\frac {b}{a}}}{2 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) - 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} + 2 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, {\left ({\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - 3 \, a^{2} b^{2} + 3 \, a b^{3} - b^{4}\right )} f\right )}}\right ]
\]
[In]
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
[Out]
[1/8*(4*(a^2 + 2*a*b - 3*b^2)*f*x*cos(f*x + e)^2 + 4*(a*b + 3*b^2)*f*x - ((3*a^2 - 2*a*b - b^2)*cos(f*x + e)^2
+ 3*a*b + b^2)*sqrt(-b/a)*log(((a^2 + 6*a*b + b^2)*cos(f*x + e)^4 - 2*(3*a*b + b^2)*cos(f*x + e)^2 - 4*((a^2
+ a*b)*cos(f*x + e)^3 - a*b*cos(f*x + e))*sqrt(-b/a)*sin(f*x + e) + b^2)/((a^2 - 2*a*b + b^2)*cos(f*x + e)^4 +
2*(a*b - b^2)*cos(f*x + e)^2 + b^2)) - 4*((a^2 - 2*a*b + b^2)*cos(f*x + e)^3 + 2*(a*b - b^2)*cos(f*x + e))*si
n(f*x + e))/((a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*f*cos(f*x + e)^2 + (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4
)*f), 1/4*(2*(a^2 + 2*a*b - 3*b^2)*f*x*cos(f*x + e)^2 + 2*(a*b + 3*b^2)*f*x + ((3*a^2 - 2*a*b - b^2)*cos(f*x +
e)^2 + 3*a*b + b^2)*sqrt(b/a)*arctan(1/2*((a + b)*cos(f*x + e)^2 - b)*sqrt(b/a)/(b*cos(f*x + e)*sin(f*x + e))
) - 2*((a^2 - 2*a*b + b^2)*cos(f*x + e)^3 + 2*(a*b - b^2)*cos(f*x + e))*sin(f*x + e))/((a^4 - 4*a^3*b + 6*a^2*
b^2 - 4*a*b^3 + b^4)*f*cos(f*x + e)^2 + (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4)*f)]
Sympy [F(-1)]
Timed out. \[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Timed out}
\]
[In]
integrate(sin(f*x+e)**2/(a+b*tan(f*x+e)**2)**2,x)
[Out]
Timed out
Maxima [A] (verification not implemented)
none
Time = 0.30 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.34
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (f x + e\right )} {\left (a + 3 \, b\right )}}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {{\left (3 \, a b + b^{2}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \sqrt {a b}} - \frac {2 \, b \tan \left (f x + e\right )^{3} + {\left (a + b\right )} \tan \left (f x + e\right )}{{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{4} + a^{3} - 2 \, a^{2} b + a b^{2} + {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{2}}}{2 \, f}
\]
[In]
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
[Out]
1/2*((f*x + e)*(a + 3*b)/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) - (3*a*b + b^2)*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^
3 - 3*a^2*b + 3*a*b^2 - b^3)*sqrt(a*b)) - (2*b*tan(f*x + e)^3 + (a + b)*tan(f*x + e))/((a^2*b - 2*a*b^2 + b^3)
*tan(f*x + e)^4 + a^3 - 2*a^2*b + a*b^2 + (a^3 - a^2*b - a*b^2 + b^3)*tan(f*x + e)^2))/f
Giac [A] (verification not implemented)
none
Time = 0.63 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.35
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (f x + e\right )} {\left (a + 3 \, b\right )}}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} {\left (3 \, a b + b^{2}\right )}}{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \sqrt {a b}} - \frac {2 \, b \tan \left (f x + e\right )^{3} + a \tan \left (f x + e\right ) + b \tan \left (f x + e\right )}{{\left (b \tan \left (f x + e\right )^{4} + a \tan \left (f x + e\right )^{2} + b \tan \left (f x + e\right )^{2} + a\right )} {\left (a^{2} - 2 \, a b + b^{2}\right )}}}{2 \, f}
\]
[In]
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
[Out]
1/2*((f*x + e)*(a + 3*b)/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) - (pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan
(f*x + e)/sqrt(a*b)))*(3*a*b + b^2)/((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*sqrt(a*b)) - (2*b*tan(f*x + e)^3 + a*tan(
f*x + e) + b*tan(f*x + e))/((b*tan(f*x + e)^4 + a*tan(f*x + e)^2 + b*tan(f*x + e)^2 + a)*(a^2 - 2*a*b + b^2)))
/f
Mupad [B] (verification not implemented)
Time = 13.81 (sec) , antiderivative size = 3301, normalized size of antiderivative = 23.92
\[
\int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Too large to display}
\]
[In]
int(sin(e + f*x)^2/(a + b*tan(e + f*x)^2)^2,x)
[Out]
(atan((((-a*b)^(1/2)*((tan(e + f*x)*(6*a*b^4 + 5*b^5 + 5*a^2*b^3))/(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b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^2*b^7 + 40*a^3*b^6 + 40*a^4*b^5 - 72*a^5*b^4 + 40*a^6*b^3 - 8*a^7*b^2))/(4*(a*b^3 + 3*a^3*b
- a^4 - 3*a^2*b^2)*(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2))))/(4*(a*b^3 + 3*a^3*b - a^4 - 3*a^2*b^2)))*(3*
a + b))/(4*(a*b^3 + 3*a^3*b - a^4 - 3*a^2*b^2))))*(-a*b)^(1/2)*(3*a + b)*1i)/(2*f*(a*b^3 + 3*a^3*b - a^4 - 3*a
^2*b^2)) - (atan((((a + 3*b)*(((a + 3*b)*((10*a*b^8 - 2*b^9 - 18*a^2*b^7 + 10*a^3*b^6 + 10*a^4*b^5 - 18*a^5*b^
4 + 10*a^6*b^3 - 2*a^7*b^2)/(a^6 - 6*a^5*b - 6*a*b^5 + b^6 + 15*a^2*b^4 - 20*a^3*b^3 + 15*a^4*b^2) - (tan(e +
f*x)*(a + 3*b)*(40*a*b^8 - 8*b^9 - 72*a^2*b^7 + 40*a^3*b^6 + 40*a^4*b^5 - 72*a^5*b^4 + 40*a^6*b^3 - 8*a^7*b^2)
)/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)*(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2))))/(4*(a*b^2*3i - a^2
*b*3i + a^3*1i - b^3*1i)) + (tan(e + f*x)*(6*a*b^4 + 5*b^5 + 5*a^2*b^3))/(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^
2*b^2))*1i)/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)) - ((a + 3*b)*(((a + 3*b)*((10*a*b^8 - 2*b^9 - 18*a^2*b
^7 + 10*a^3*b^6 + 10*a^4*b^5 - 18*a^5*b^4 + 10*a^6*b^3 - 2*a^7*b^2)/(a^6 - 6*a^5*b - 6*a*b^5 + b^6 + 15*a^2*b^
4 - 20*a^3*b^3 + 15*a^4*b^2) + (tan(e + f*x)*(a + 3*b)*(40*a*b^8 - 8*b^9 - 72*a^2*b^7 + 40*a^3*b^6 + 40*a^4*b^
5 - 72*a^5*b^4 + 40*a^6*b^3 - 8*a^7*b^2))/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)*(a^4 - 4*a^3*b - 4*a*b^3
+ b^4 + 6*a^2*b^2))))/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)) - (tan(e + f*x)*(6*a*b^4 + 5*b^5 + 5*a^2*b^3
))/(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2))*1i)/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)))/(((a + 3*b)*(
((a + 3*b)*((10*a*b^8 - 2*b^9 - 18*a^2*b^7 + 10*a^3*b^6 + 10*a^4*b^5 - 18*a^5*b^4 + 10*a^6*b^3 - 2*a^7*b^2)/(a
^6 - 6*a^5*b - 6*a*b^5 + b^6 + 15*a^2*b^4 - 20*a^3*b^3 + 15*a^4*b^2) - (tan(e + f*x)*(a + 3*b)*(40*a*b^8 - 8*b
^9 - 72*a^2*b^7 + 40*a^3*b^6 + 40*a^4*b^5 - 72*a^5*b^4 + 40*a^6*b^3 - 8*a^7*b^2))/(4*(a*b^2*3i - a^2*b*3i + a^
3*1i - b^3*1i)*(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2))))/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)) + (t
an(e + f*x)*(6*a*b^4 + 5*b^5 + 5*a^2*b^3))/(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2)))/(4*(a*b^2*3i - a^2*b*
3i + a^3*1i - b^3*1i)) - (5*a*b^4 + (3*b^5)/2 + (3*a^2*b^3)/2)/(a^6 - 6*a^5*b - 6*a*b^5 + b^6 + 15*a^2*b^4 - 2
0*a^3*b^3 + 15*a^4*b^2) + ((a + 3*b)*(((a + 3*b)*((10*a*b^8 - 2*b^9 - 18*a^2*b^7 + 10*a^3*b^6 + 10*a^4*b^5 - 1
8*a^5*b^4 + 10*a^6*b^3 - 2*a^7*b^2)/(a^6 - 6*a^5*b - 6*a*b^5 + b^6 + 15*a^2*b^4 - 20*a^3*b^3 + 15*a^4*b^2) + (
tan(e + f*x)*(a + 3*b)*(40*a*b^8 - 8*b^9 - 72*a^2*b^7 + 40*a^3*b^6 + 40*a^4*b^5 - 72*a^5*b^4 + 40*a^6*b^3 - 8*
a^7*b^2))/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i)*(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2))))/(4*(a*b^2*
3i - a^2*b*3i + a^3*1i - b^3*1i)) - (tan(e + f*x)*(6*a*b^4 + 5*b^5 + 5*a^2*b^3))/(a^4 - 4*a^3*b - 4*a*b^3 + b^
4 + 6*a^2*b^2)))/(4*(a*b^2*3i - a^2*b*3i + a^3*1i - b^3*1i))))*(a + 3*b)*1i)/(2*f*(a*b^2*3i - a^2*b*3i + a^3*1
i - b^3*1i)) - ((tan(e + f*x)*(a + b))/(2*(a^2 - 2*a*b + b^2)) + (b*tan(e + f*x)^3)/(a^2 - 2*a*b + b^2))/(f*(a
+ tan(e + f*x)^2*(a + b) + b*tan(e + f*x)^4))